package cz.boxdesign.library.web.decorator;

import org.displaytag.decorator.TableDecorator;

import cz.boxdesign.library.entity.Author;

public class AutorTableDecorator extends TableDecorator {

  public String getEditUrl() {
    Author a = (Author) getCurrentRowObject();
    return "<a href=\"/isLibrary/authors/edit.do?authorId=" + a.getId() + "\"><img src=\"/isLibrary/images/icons/edit_16.png\"/></a>";
  }

  public String getShowUrl() {
    Author a = (Author) getCurrentRowObject();
    return "<a href=\"/isLibrary/authors/show.do?authorId=" + a.getId() + "\"><img src=\"/isLibrary/images/icons/goto_16.png\"/></a>";
  }

  public String getDeleteUrl() {
    Author a = (Author) getCurrentRowObject();
    return "<a href=\"javascript:openDialog('authors/delete.do?authorId=" + a.getId()
        + "')\"><img src=\"/isLibrary/images/icons/delete_16.gif\"/></a>";
  }
}
